﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Com;
using Com.GUI;
using Com.BU;
using Com.DA;
using ColdStorage.DOL;

namespace ColdStorage.GUI
{
	/// <summary>
	/// Interaction logic for ucStorageInformation.xaml
	/// </summary>
	public partial class ucStorageInformation : UserControl
	{
        //ListInformation ucL = new ListInformation();
        //ListInformation ucL = new ListInformation();

        

		public ucStorageInformation()
		{
			this.InitializeComponent();
            loadLocation();
		}

        public void loadLocation()
        {
                    
            cbxLocation.Items.Clear();
            LibraryManagerInCom.loadLocation();
            cbxLocation.ItemsSource = LibraryManagerInCom.LocationList;
            cbxLocation.DisplayMemberPath = "location";
            cbxLocation.SelectedIndex = -1;
            
        }

        private void btnNewRoom_Click(object sender, RoutedEventArgs e)
        {
            //this.ucL.addRoomCold();
        }

        private void cbxLocation_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            txtlocationTemperature.Text = ((tb_location)cbxLocation.SelectedItem).max_temperature.ToString();
        }

        private void ucInfoStorage_Loaded(object sender, RoutedEventArgs e)
        {
           // loadLocation();
        }
	}
}